package com.android.server;

import java.io.Serializable;

import com.android.client.GreetingService;
import com.android.client.event.AbstractEvent;
import com.android.server.actionHandler.ActionHandler;
import com.android.server.actionHandler.ActionHandlerFactory;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

/**
 * The server side implementation of the RPC service.
 */
@SuppressWarnings("serial")
public class GreetingServiceImpl extends RemoteServiceServlet implements
		GreetingService {

	@Override
	public <T extends Serializable> T execute(
			AbstractEvent<? extends EventHandler> event) {
		ActionHandler handler = ActionHandlerFactory.getHanlder(event);
		return (T) handler.execute(event); 
	}

}
